fix: markdown rendering for custom types#483
Conversation
|
Nice, looks much better! I'm fine with the current implementation for now, but as an improvement we should find a way to already render the correct style before the closing tag appears. |
Done :) |
| position: absolute; | ||
| inset: 0; | ||
| background-color: currentcolor; | ||
| mask-image: url("https://da.live/img/icons/s2-icon-checkmark-20-n.svg"); |
There was a problem hiding this comment.
can we set the URL via a JS custom property (--checkmark-icon: url(${...})) using codeBase, the same way inline SVG refs are handled instead of hardcoding the CDN url?
There was a problem hiding this comment.
We could, but mask-image on a pseudo-element is purely decorative styling with no functional JS dependency. Adding a custom property would couple js and css just to avoid a stable CDN URL and the trade-off didnt feel worth it here.
| const IMAGE_EXTS = new Set(['png', 'jpg', 'jpeg', 'gif', 'webp', 'svg', 'mp4', 'webm', 'mov']); | ||
| const TABLE_EXTS = new Set(['json', 'xlsx', 'xls', 'csv']); | ||
|
|
||
| export function fileIconName(filename) { |
There was a problem hiding this comment.
the old code had a comment saying this mirrors entryTypeFromExtension in browse/utils.js. we removed the comment but the duplication is still there. why not move fileIconName to nx2/utils/ and delete browse/utils.js's version, or at least import from there? two parallel implementations will diverge.
There was a problem hiding this comment.
Browse doesnt exist anymore - the comment is a remnant from when we had custom browse block similar to chat.
Preview at https://da.live/canvas?nx=ew-md&nxver=2#/exp-workspace/frescopa/index